<template>
  <transition
    enter-active-class="animated fadeInDown"
    leave-active-class="animated fadeOutUp"
    >
    <div
        class="title-wrapper"
        v-show="menuVisible"
    >
      <div class="left">
        <span class="iconfont icon" @click="back">&#xe744;</span>
      </div>
      <div class="right">
        <div class="icon-wrapper">
          <span class="iconfont icon" @click.stop.prevent="gotoBookShelf">&#xe609;</span>
          <span class="iconfont icon">&#xe619;</span>
          <span class="iconfont icon ">&#xe700;</span>
        </div>
      </div>
    </div>
  </transition>
</template>

<script>
import { ebookMixin } from '../../utils/mixin'
export default {
  name: 'EbookTitle',
  mixins: [ebookMixin],
  methods: {
    back () {
      this.$router.back()
    },
    gotoBookShelf () {
      this.$router.push('/store/shelf')
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '../../assets/styles/global.styl'
.title-wrapper
  position: absolute
  top: 0
  left: 0
  z-index: 101
  display: flex
  width: 100%
  height: px2rem(48)
  line-height: px2rem(48)
  background: white
  box-shadow: 0 px2rem(8) px2rem(8) rgba(0, 0, 0, .15)
  .left
    flex: 0 0 px2rem(60)
    .icon
      font-size px2rem(30)
      center()
  .right
    flex: 1
    display: flex
    // 水平方向排列，居右排列
    justify-content: flex-end
    .icon-wrapper
      flex: 0 0 px2rem(120)
      center()
      .icon
        center()
        width: px2rem(40)
        font-size: px2rem(22)
</style>
